// [[ OnflowGenerator File UUID: f36b0b1c675a4667bad6bcb53fc9a3d3  ]]
package com.itdct.onflow.system.log.controller

import com.itdct.onflow.core.annotation.ApiParam
import com.itdct.onflow.core.type.*
import com.itdct.onflow.core.vo.RespPageVo
import com.itdct.onflow.core.vo.RespVo
import com.itdct.onflow.system.common.base.BaseSysController
import com.itdct.onflow.system.configuration.controller.SysConfigurationController
import com.itdct.onflow.system.configuration.controller.SysConfigurationController.Companion
import com.itdct.onflow.system.configuration.qo.SysConfigurationSearchQo
import com.itdct.onflow.system.log.qo.SysApiLogEditQo
import com.itdct.onflow.system.log.qo.SysApiLogSearchQo
import com.itdct.onflow.system.log.service.SysApiLogService
import com.itdct.onflow.system.log.vo.SysApiLogDetailVo
import com.itdct.onflow.system.log.vo.SysApiLogListVo
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.http.MediaType
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*

/**
 * @author DCTANT
 * @date 2025-09-23 10:57:51
 * @version 1.0
 * @description 系统接口访问日志接口控制
 */
@Tag(name = SysApiLogController.moduleName)
@RestController
@RequestMapping(value = ["/sysApiLog"], produces = [MediaType.APPLICATION_JSON_VALUE], method = [RequestMethod.POST])
class SysApiLogController(
    val sysApiLogService: SysApiLogService
) : BaseSysController() {
    companion object {
        const val moduleName = "系统接口访问日志"
    }

    @Operation(summary = moduleName + "添加")
    @PostMapping("/add.adw")
    fun add(@RequestBody @Validated(Add::class) qo: SysApiLogEditQo): RespVo<Long> {
        return sysApiLogService.add(qo, getContext())
    }

    @Operation(summary = moduleName + "更新")
    @PostMapping("/update.adw")
    fun update(@RequestBody @Validated(Update::class) qo: SysApiLogEditQo): RespVo<Unit> {
        return sysApiLogService.update(qo, getContext())
    }

    @ApiParam(important = true)
    @Operation(summary = moduleName + "删除")
    @PostMapping("/delete.adw")
    fun delete(@RequestBody @Validated(Delete::class) qo: SysApiLogEditQo): RespVo<Unit> {
        return sysApiLogService.delete(qo, getContext())
    }

    @Operation(summary = moduleName + "详情")
    @PostMapping("/detail.adw")
    fun detail(@RequestBody @Validated(Detail::class) qo: SysApiLogSearchQo): RespVo<SysApiLogDetailVo> {
        return sysApiLogService.detail(qo, getContext())
    }

    @Operation(summary = moduleName + "列表")
    @PostMapping("/page.adw")
    fun page(@RequestBody @Validated(Page::class) qo: SysApiLogSearchQo): RespPageVo<SysApiLogListVo> {
        return sysApiLogService.page(qo, getContext())
    }

    @Operation(summary = moduleName + "导出")
    @PostMapping("/export.adw")
    fun export(@RequestBody qo: SysApiLogSearchQo): RespVo<Unit> {
        return sysApiLogService.export(qo, getContext())
    }

// [[ OnflowGenerator Range (- selectFunctions -) Start ]]

// [[ OnflowGenerator Range (- selectFunctions -) End ]]
}